from django.db import models
from apps.common.base.models import BaseModel
from apps.system.lessee.models import Lessee

class Client(BaseModel):

    types = (
        ('app', "APP"),
        ('minipro', "小程序"),
        ('web', "web"),
        ('h5', "h5"),
    )
    lessee=models.ForeignKey(Lessee, related_name="lessee_client", verbose_name='租户', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    clientname=models.CharField("客户端标识", max_length=200, unique=True, blank=True, default='')
    appname=models.CharField("客户端名称", max_length=200, blank=True, default='')
    types=models.CharField("类型", max_length=200, choices=types, blank=True, default='')
    realPay=models.DecimalField("实际支付", max_digits=10, decimal_places=2, default=0)
    currentVersion=models.CharField("当前版本", max_length=200, blank=True)
    currentVersionNum=models.CharField("最新版本号", max_length=200, blank=True)
    regUrl=models.CharField("APP注册地址", max_length=200, blank=True)
    updateUrlForAndriod=models.CharField("安卓下载地址", max_length=200, blank=True)
    updateUrlForIos=models.CharField("苹果下载地址", max_length=200, blank=True)
    checking=models.BooleanField("是否在审核中", default=False)
    remark=models.CharField("备注", max_length=200, null=True, blank=True)
    mch_id=models.CharField("商户id", max_length=200, null=True, blank=True)
    mch_key=models.CharField("商户key", max_length=200, null=True, blank=True)
    appid=models.CharField("APPID", max_length=200, null=True, blank=True)
    appsecret=models.CharField("APP秘钥", max_length=200, null=True, blank=True)
    notify_url=models.CharField("微信异步回调url", max_length=200, null=True, blank=True)
    notify_url_return=models.CharField("微信退款异步回调url", max_length=200, null=True, blank=True)
    logo=models.CharField("logo", max_length=2000, null=True, blank=True)
    miniproUrl=models.CharField("小程序码地址", max_length=2000, null=True, blank=True)
    baseUrl=models.CharField("baseUrl地址", max_length=2000, null=True, blank=True)

    class Meta:
        verbose_name = 'Client'
        verbose_name_plural = verbose_name